package org.example.auxiliary;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package org.example.dao
 * @date 2024/4/16 上午11:04
 */
@Order(1)
@Component
public class Initializer implements CommandLineRunner {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public void run(String... args) throws Exception {
        System.out.println("初始化数据");
        String sql = "create table if not exists seacher(id char(50),name char(50),department int)";



       jdbcTemplate.execute(sql);


    }
}
